<jsp:include page="header.jsp">
			<jsp:param value="item2" name="item"/>
</jsp:include> 
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<section class="content">
	<section class="widget">
		<header>
			<span class="icon">&#128196;</span>
			<hgroup>
				<h1>点数兑换管理</h1>
				<!--<h2>兑换物品列表</h2>
			--></hgroup>
		</header>
		<div class="content">
		<div class="tabs" id="tabs">
		    <ul>
		        <li><a href="ruleManage">兑换规则</a></li>
		        <li><a href="giftManage">物品</a></li>
		        <li class="on">修改状态</li>
		        
		    </ul>
		    	
			<div class="show">
					<s:if test='exchangeRecordList == null || exchangeRecordList.{?#this.exchangeStatus == "否"}.size == 0'>
						无未处理的兑换记录
					</s:if>
					<s:else>
						<table id="myTable">
							<tr>
								<th>兑换时间</th>
								<th>兑换物品</th>
								<th>兑换数量</th>
								<th>花费点数</th>
								<th>员工号</th>
								<th>员工姓名</th>
								<th>已兑换</th>
							</tr>
							<s:iterator value="exchangeRecordList" id="rec" status="sta">
							
								<tr>
								<s:if test='#rec.exchangeStatus =="否" '>
									<td><s:property value="dateList[#sta.index]"/></td>
									<td><s:property value="#rec.gift.giftName"/></td>
									<td><s:property value="#rec.number"/></td>
									<td><s:property value="#rec.points"/></td>
									<td><s:property value="#rec.id.userid"/></td>
									<td><s:property value="#rec.userInfo.userName"/></td>
									<td>
									<form action="changeExchangeRecordStatus" method="post">
									<input type="hidden" name="exchangeRecord.id.exchangeTime" value="<s:property value='#rec.id.exchangeTime'/>"/>
									<input type="hidden" name="exchangeRecord.id.userid" value="<s:property value='#rec.id.userid'/>"/>
									<input type="submit" class="button white" value="是"/>
									</form>
									</td>
								</s:if>
								</tr>
							</s:iterator>
						</table>
					</s:else>
			</div>
<script type="text/javascript">
   	var message="<%=request.getAttribute("message")%>";
		if(message!="null"){
			alert(message);
		}
</script>
<%@ include file="footer.jsp" %>